﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace UwaySoft.EsheetServer.BizLogic
{
    public class WebServerHttpModule : IHttpModule
    {

        private void Application_BeginRequest(object sender, EventArgs e)
        {
            //HttpApplication application = (HttpApplication)sender;
            //HttpContext context = application.Context;
            //HttpRequest request = application.Request;
            //HttpResponse response = application.Response;

            //StringBuilder sb = new StringBuilder();
            //sb.Append(DateTime.Now.ToString() + "\t" + request.FilePath + "\r\n");
            //foreach (string key in request.Form.AllKeys)
            //{
            //    string view = request.Form[key];
            //    sb.Append(string.Format("{0} \t {1} \r\n", key, view));
            //}
            //sb.Append("\r\n");
            //sb.Append("\r\n");
            //System.IO.File.WriteAllText("c:\\log\\ServerHttpModule" + DateTime.Now.ToString() + ".log", sb.ToString());
            
        }



        private void Application_EndRequest(object sender, EventArgs e)
        {
            //HttpApplication application = (HttpApplication)sender;
            //HttpContext context = application.Context;
            //HttpRequest request = application.Request;
            //HttpResponse response = application.Response;

        }





        public void Dispose()
        { }
        
        public void Init(HttpApplication application)
        {
            application.BeginRequest += new EventHandler(Application_BeginRequest);
            application.EndRequest += new EventHandler(Application_EndRequest);
        }

    }
}
